package com.erlinyou.im.service.chat;


import java.util.ArrayList;
import java.util.List;

import com.erlinyou.base.service.BaseService;
import com.erlinyou.im.model.chat.ChatSession;
import com.erlinyou.im.model.chat.ChatMessage;
import com.erlinyou.im.model.offline.OfflineMessage;

public interface IChatMessageService extends BaseService<ChatMessage, String> {
	public boolean existsByClientid(String clientId);
	public boolean saveMessage(ChatMessage chatMessage,List<OfflineMessage> offlineMessages, List<ChatSession> chatContacts)throws RuntimeException ;
	public boolean saveMessage(ChatMessage chatMessage,List<OfflineMessage> offlineMessages)throws RuntimeException ;
	public boolean saveMessage(List<OfflineMessage> offlineMessages)throws RuntimeException ;
	public void revokeMessage(ChatMessage chatMessage,List<ChatSession> chatSession);
	public ChatMessage findByFAndId(Long f,String id);
	
	
	public List<ChatMessage> getMsg(String userId, String gid,Long inGourpTime, Integer startPage, Integer currentPage,int ctype);
	public Integer getCount(String valueOf, String gid);
	public List<ChatMessage> getMsg(String valueOf, String gid, Integer page, Integer rows,int ctype);
	public List<ChatMessage> getMsgCallCenter(Long userId, String string, Integer page, Integer rows,int ctype);
	public List<ChatMessage> findAllByCt(ArrayList<Long> arrayList);
	public ChatMessage findByfromIdAndtoId(Long userid,String gid,Integer ctype);
	public ChatMessage findByClientid(String clientid);
	public List<ChatMessage> findByCtype(int i);
}
